// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Request for creating a workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkloadRequest {
    /// Required. The resource name of the new Workload's parent.
    /// Must be of the form `organizations/{org_id}/locations/{location_id}`.
    pub parent: std::string::String,

    /// Required. Assured Workload to create
    pub workload: std::option::Option<crate::model::Workload>,

    /// Optional. A identifier associated with the workload and underlying projects which
    /// allows for the break down of billing costs for a workload. The value
    /// provided for the identifier will add a label to the workload and contained
    /// projects with the identifier as the value.
    pub external_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateWorkloadRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [workload][crate::model::CreateWorkloadRequest::workload].
    pub fn set_workload<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload][crate::model::CreateWorkloadRequest::workload].
    pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = v.map(|x| x.into());
        self
    }

    /// Sets the value of [external_id][crate::model::CreateWorkloadRequest::external_id].
    pub fn set_external_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.external_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.CreateWorkloadRequest"
    }
}

/// Request for Updating a workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkloadRequest {
    /// Required. The workload to update.
    /// The workload's `name` field is used to identify the workload to be updated.
    /// Format:
    /// organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    pub workload: std::option::Option<crate::model::Workload>,

    /// Required. The list of fields to be updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workload][crate::model::UpdateWorkloadRequest::workload].
    pub fn set_workload<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload][crate::model::UpdateWorkloadRequest::workload].
    pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.UpdateWorkloadRequest"
    }
}

/// Request for deleting a Workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkloadRequest {
    /// Required. The `name` field is used to identify the workload.
    /// Format:
    /// organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    pub name: std::string::String,

    /// Optional. The etag of the workload.
    /// If this is provided, it must match the server's etag.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteWorkloadRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteWorkloadRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for DeleteWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.DeleteWorkloadRequest"
    }
}

/// Request for fetching a workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkloadRequest {
    /// Required. The resource name of the Workload to fetch. This is the workload's
    /// relative path in the API, formatted as
    /// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    /// For example,
    /// "organizations/123/locations/us-east1/workloads/assured-workload-1".
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetWorkloadRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.GetWorkloadRequest"
    }
}

/// Request for fetching workloads in an organization.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkloadsRequest {
    /// Required. Parent Resource to list workloads from.
    /// Must be of the form `organizations/{org_id}/locations/{location}`.
    pub parent: std::string::String,

    /// Page size.
    pub page_size: i32,

    /// Page token returned from previous request. Page token contains context from
    /// previous request. Page token needs to be passed in the second and following
    /// requests.
    pub page_token: std::string::String,

    /// A custom filter for filtering by properties of a workload. At this time,
    /// only filtering by labels is supported.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkloadsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListWorkloadsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListWorkloadsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListWorkloadsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListWorkloadsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkloadsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.ListWorkloadsRequest"
    }
}

/// Response of ListWorkloads endpoint.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkloadsResponse {
    /// List of Workloads under a given parent.
    pub workloads: std::vec::Vec<crate::model::Workload>,

    /// The next page token. Return empty if reached the last page.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkloadsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workloads][crate::model::ListWorkloadsResponse::workloads].
    pub fn set_workloads<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Workload>,
    {
        use std::iter::Iterator;
        self.workloads = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListWorkloadsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkloadsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.ListWorkloadsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListWorkloadsResponse {
    type PageItem = crate::model::Workload;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workloads
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// A Workload object for managing highly regulated workloads of cloud
/// customers.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Workload {
    /// Optional. The resource name of the workload.
    /// Format:
    /// organizations/{organization}/locations/{location}/workloads/{workload}
    ///
    /// Read-only.
    pub name: std::string::String,

    /// Required. The user-assigned display name of the Workload.
    /// When present it must be between 4 to 30 characters.
    /// Allowed characters are: lowercase and uppercase letters, numbers,
    /// hyphen, and spaces.
    ///
    /// Example: My Workload
    pub display_name: std::string::String,

    /// Output only. The resources associated with this workload.
    /// These resources will be created when creating the workload.
    /// If any of the projects already exist, the workload creation will fail.
    /// Always read only.
    pub resources: std::vec::Vec<crate::model::workload::ResourceInfo>,

    /// Required. Immutable. Compliance Regime associated with this workload.
    pub compliance_regime: crate::model::workload::ComplianceRegime,

    /// Output only. Immutable. The Workload creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The billing account used for the resources which are
    /// direct children of workload. This billing account is initially associated
    /// with the resources created as part of Workload creation.
    /// After the initial creation of these resources, the customer can change
    /// the assigned billing account.
    /// The resource name has the form
    /// `billingAccounts/{billing_account_id}`. For example,
    /// `billingAccounts/012345-567890-ABCDEF`.
    pub billing_account: std::string::String,

    /// Optional. ETag of the workload, it is calculated on the basis
    /// of the Workload contents. It will be used in Update & Delete operations.
    pub etag: std::string::String,

    /// Optional. Labels applied to the workload.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Input only. The parent resource for the resources managed by this Assured Workload. May
    /// be either empty or a folder resource which is a child of the
    /// Workload parent. If not specified all resources are created under the
    /// parent organization.
    /// Format:
    /// folders/{folder_id}
    pub provisioned_resources_parent: std::string::String,

    /// Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
    /// CMEK key is provisioned.
    /// This field is deprecated as of Feb 28, 2022.
    /// In order to create a Keyring, callers should specify,
    /// ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    #[deprecated]
    pub kms_settings: std::option::Option<crate::model::workload::KMSSettings>,

    /// Input only. Resource properties that are used to customize workload resources.
    /// These properties (such as custom project id) will be used to create
    /// workload resources if possible. This field is optional.
    pub resource_settings: std::vec::Vec<crate::model::workload::ResourceSettings>,

    /// Output only. Represents the KAJ enrollment state of the given workload.
    pub kaj_enrollment_state: crate::model::workload::KajEnrollmentState,

    /// Optional. Indicates the sovereignty status of the given workload.
    /// Currently meant to be used by Europe/Canada customers.
    pub enable_sovereign_controls: bool,

    /// Output only. Represents the SAA enrollment response of the given workload.
    /// SAA enrollment response is queried during GetWorkload call.
    /// In failure cases, user friendly error message is shown in SAA details page.
    pub saa_enrollment_response: std::option::Option<crate::model::workload::SaaEnrollmentResponse>,

    /// Output only. Urls for services which are compliant for this Assured Workload, but which
    /// are currently disallowed by the ResourceUsageRestriction org policy.
    /// Invoke RestrictAllowedResources endpoint to allow your project developers
    /// to use these services in their environment."
    pub compliant_but_disallowed_services: std::vec::Vec<std::string::String>,

    /// Optional. Compliance Regime associated with this workload.
    pub partner: crate::model::workload::Partner,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Workload {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Workload::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Workload::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [resources][crate::model::Workload::resources].
    pub fn set_resources<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::workload::ResourceInfo>,
    {
        use std::iter::Iterator;
        self.resources = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [compliance_regime][crate::model::Workload::compliance_regime].
    pub fn set_compliance_regime<
        T: std::convert::Into<crate::model::workload::ComplianceRegime>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compliance_regime = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Workload::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Workload::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [billing_account][crate::model::Workload::billing_account].
    pub fn set_billing_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.billing_account = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::Workload::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Workload::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [provisioned_resources_parent][crate::model::Workload::provisioned_resources_parent].
    pub fn set_provisioned_resources_parent<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.provisioned_resources_parent = v.into();
        self
    }

    /// Sets the value of [kms_settings][crate::model::Workload::kms_settings].
    #[deprecated]
    pub fn set_kms_settings<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::workload::KMSSettings>,
    {
        self.kms_settings = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [kms_settings][crate::model::Workload::kms_settings].
    #[deprecated]
    pub fn set_or_clear_kms_settings<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::workload::KMSSettings>,
    {
        self.kms_settings = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resource_settings][crate::model::Workload::resource_settings].
    pub fn set_resource_settings<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::workload::ResourceSettings>,
    {
        use std::iter::Iterator;
        self.resource_settings = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [kaj_enrollment_state][crate::model::Workload::kaj_enrollment_state].
    pub fn set_kaj_enrollment_state<
        T: std::convert::Into<crate::model::workload::KajEnrollmentState>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.kaj_enrollment_state = v.into();
        self
    }

    /// Sets the value of [enable_sovereign_controls][crate::model::Workload::enable_sovereign_controls].
    pub fn set_enable_sovereign_controls<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.enable_sovereign_controls = v.into();
        self
    }

    /// Sets the value of [saa_enrollment_response][crate::model::Workload::saa_enrollment_response].
    pub fn set_saa_enrollment_response<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::workload::SaaEnrollmentResponse>,
    {
        self.saa_enrollment_response = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [saa_enrollment_response][crate::model::Workload::saa_enrollment_response].
    pub fn set_or_clear_saa_enrollment_response<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::workload::SaaEnrollmentResponse>,
    {
        self.saa_enrollment_response = v.map(|x| x.into());
        self
    }

    /// Sets the value of [compliant_but_disallowed_services][crate::model::Workload::compliant_but_disallowed_services].
    pub fn set_compliant_but_disallowed_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.compliant_but_disallowed_services = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [partner][crate::model::Workload::partner].
    pub fn set_partner<T: std::convert::Into<crate::model::workload::Partner>>(
        mut self,
        v: T,
    ) -> Self {
        self.partner = v.into();
        self
    }
}

impl wkt::message::Message for Workload {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.Workload"
    }
}

/// Defines additional types related to [Workload].
pub mod workload {
    #[allow(unused_imports)]
    use super::*;

    /// Represent the resources that are children of this Workload.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ResourceInfo {
        /// Resource identifier.
        /// For a project this represents project_number.
        pub resource_id: i64,

        /// Indicates the type of resource.
        pub resource_type: crate::model::workload::resource_info::ResourceType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ResourceInfo {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [resource_id][crate::model::workload::ResourceInfo::resource_id].
        pub fn set_resource_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.resource_id = v.into();
            self
        }

        /// Sets the value of [resource_type][crate::model::workload::ResourceInfo::resource_type].
        pub fn set_resource_type<
            T: std::convert::Into<crate::model::workload::resource_info::ResourceType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.resource_type = v.into();
            self
        }
    }

    impl wkt::message::Message for ResourceInfo {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.assuredworkloads.v1.Workload.ResourceInfo"
        }
    }

    /// Defines additional types related to [ResourceInfo].
    pub mod resource_info {
        #[allow(unused_imports)]
        use super::*;

        /// The type of resource.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ResourceType {
            /// Unknown resource type.
            Unspecified,
            /// Consumer project.
            /// AssuredWorkloads Projects are no longer supported. This field will be
            /// ignored only in CreateWorkload requests. ListWorkloads and GetWorkload
            /// will continue to provide projects information.
            /// Use CONSUMER_FOLDER instead.
            #[deprecated]
            ConsumerProject,
            /// Consumer Folder.
            ConsumerFolder,
            /// Consumer project containing encryption keys.
            EncryptionKeysProject,
            /// Keyring resource that hosts encryption keys.
            Keyring,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [ResourceType::value] or
            /// [ResourceType::name].
            UnknownValue(resource_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod resource_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl ResourceType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::ConsumerProject => std::option::Option::Some(1),
                    Self::ConsumerFolder => std::option::Option::Some(4),
                    Self::EncryptionKeysProject => std::option::Option::Some(2),
                    Self::Keyring => std::option::Option::Some(3),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("RESOURCE_TYPE_UNSPECIFIED"),
                    Self::ConsumerProject => std::option::Option::Some("CONSUMER_PROJECT"),
                    Self::ConsumerFolder => std::option::Option::Some("CONSUMER_FOLDER"),
                    Self::EncryptionKeysProject => {
                        std::option::Option::Some("ENCRYPTION_KEYS_PROJECT")
                    }
                    Self::Keyring => std::option::Option::Some("KEYRING"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for ResourceType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for ResourceType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for ResourceType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::ConsumerProject,
                    2 => Self::EncryptionKeysProject,
                    3 => Self::Keyring,
                    4 => Self::ConsumerFolder,
                    _ => Self::UnknownValue(resource_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for ResourceType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "CONSUMER_PROJECT" => Self::ConsumerProject,
                    "CONSUMER_FOLDER" => Self::ConsumerFolder,
                    "ENCRYPTION_KEYS_PROJECT" => Self::EncryptionKeysProject,
                    "KEYRING" => Self::Keyring,
                    _ => Self::UnknownValue(resource_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for ResourceType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::ConsumerProject => serializer.serialize_i32(1),
                    Self::ConsumerFolder => serializer.serialize_i32(4),
                    Self::EncryptionKeysProject => serializer.serialize_i32(2),
                    Self::Keyring => serializer.serialize_i32(3),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for ResourceType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceType>::new(
                    ".google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType",
                ))
            }
        }
    }

    /// Settings specific to the Key Management Service.
    /// This message is deprecated.
    /// In order to create a Keyring, callers should specify,
    /// ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    #[deprecated]
    pub struct KMSSettings {
        /// Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
        /// new version of the crypto key and mark it as the primary.
        pub next_rotation_time: std::option::Option<wkt::Timestamp>,

        /// Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
        /// Management Service automatically rotates a key. Must be at least 24 hours
        /// and at most 876,000 hours.
        pub rotation_period: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl KMSSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [next_rotation_time][crate::model::workload::KMSSettings::next_rotation_time].
        pub fn set_next_rotation_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.next_rotation_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [next_rotation_time][crate::model::workload::KMSSettings::next_rotation_time].
        pub fn set_or_clear_next_rotation_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.next_rotation_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [rotation_period][crate::model::workload::KMSSettings::rotation_period].
        pub fn set_rotation_period<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.rotation_period = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [rotation_period][crate::model::workload::KMSSettings::rotation_period].
        pub fn set_or_clear_rotation_period<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.rotation_period = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for KMSSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.assuredworkloads.v1.Workload.KMSSettings"
        }
    }

    /// Represent the custom settings for the resources to be created.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ResourceSettings {
        /// Resource identifier.
        /// For a project this represents project_id. If the project is already
        /// taken, the workload creation will fail.
        /// For KeyRing, this represents the keyring_id.
        /// For a folder, don't set this value as folder_id is assigned by Google.
        pub resource_id: std::string::String,

        /// Indicates the type of resource. This field should be specified to
        /// correspond the id to the right resource type (CONSUMER_FOLDER or
        /// ENCRYPTION_KEYS_PROJECT)
        pub resource_type: crate::model::workload::resource_info::ResourceType,

        /// User-assigned resource display name.
        /// If not empty it will be used to create a resource with the specified
        /// name.
        pub display_name: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ResourceSettings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [resource_id][crate::model::workload::ResourceSettings::resource_id].
        pub fn set_resource_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.resource_id = v.into();
            self
        }

        /// Sets the value of [resource_type][crate::model::workload::ResourceSettings::resource_type].
        pub fn set_resource_type<
            T: std::convert::Into<crate::model::workload::resource_info::ResourceType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.resource_type = v.into();
            self
        }

        /// Sets the value of [display_name][crate::model::workload::ResourceSettings::display_name].
        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.display_name = v.into();
            self
        }
    }

    impl wkt::message::Message for ResourceSettings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.assuredworkloads.v1.Workload.ResourceSettings"
        }
    }

    /// Signed Access Approvals (SAA) enrollment response.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SaaEnrollmentResponse {
        /// Indicates SAA enrollment status of a given workload.
        pub setup_status:
            std::option::Option<crate::model::workload::saa_enrollment_response::SetupState>,

        /// Indicates SAA enrollment setup error if any.
        pub setup_errors:
            std::vec::Vec<crate::model::workload::saa_enrollment_response::SetupError>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SaaEnrollmentResponse {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [setup_status][crate::model::workload::SaaEnrollmentResponse::setup_status].
        pub fn set_setup_status<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::workload::saa_enrollment_response::SetupState>,
        {
            self.setup_status = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [setup_status][crate::model::workload::SaaEnrollmentResponse::setup_status].
        pub fn set_or_clear_setup_status<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::workload::saa_enrollment_response::SetupState>,
        {
            self.setup_status = v.map(|x| x.into());
            self
        }

        /// Sets the value of [setup_errors][crate::model::workload::SaaEnrollmentResponse::setup_errors].
        pub fn set_setup_errors<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::workload::saa_enrollment_response::SetupError>,
        {
            use std::iter::Iterator;
            self.setup_errors = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for SaaEnrollmentResponse {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse"
        }
    }

    /// Defines additional types related to [SaaEnrollmentResponse].
    pub mod saa_enrollment_response {
        #[allow(unused_imports)]
        use super::*;

        /// Setup state of SAA enrollment.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum SetupState {
            /// Unspecified.
            Unspecified,
            /// SAA enrollment pending.
            StatusPending,
            /// SAA enrollment comopleted.
            StatusComplete,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [SetupState::value] or
            /// [SetupState::name].
            UnknownValue(setup_state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod setup_state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl SetupState {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::StatusPending => std::option::Option::Some(1),
                    Self::StatusComplete => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("SETUP_STATE_UNSPECIFIED"),
                    Self::StatusPending => std::option::Option::Some("STATUS_PENDING"),
                    Self::StatusComplete => std::option::Option::Some("STATUS_COMPLETE"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for SetupState {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for SetupState {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for SetupState {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::StatusPending,
                    2 => Self::StatusComplete,
                    _ => Self::UnknownValue(setup_state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for SetupState {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "SETUP_STATE_UNSPECIFIED" => Self::Unspecified,
                    "STATUS_PENDING" => Self::StatusPending,
                    "STATUS_COMPLETE" => Self::StatusComplete,
                    _ => Self::UnknownValue(setup_state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for SetupState {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::StatusPending => serializer.serialize_i32(1),
                    Self::StatusComplete => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for SetupState {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SetupState>::new(
                    ".google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState",
                ))
            }
        }

        /// Setup error of SAA enrollment.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum SetupError {
            /// Unspecified.
            Unspecified,
            /// Invalid states for all customers, to be redirected to AA UI for
            /// additional details.
            ErrorInvalidBaseSetup,
            /// Returned when there is not an EKM key configured.
            ErrorMissingExternalSigningKey,
            /// Returned when there are no enrolled services or the customer is
            /// enrolled in CAA only for a subset of services.
            ErrorNotAllServicesEnrolled,
            /// Returned when exception was encountered during evaluation of other
            /// criteria.
            ErrorSetupCheckFailed,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [SetupError::value] or
            /// [SetupError::name].
            UnknownValue(setup_error::UnknownValue),
        }

        #[doc(hidden)]
        pub mod setup_error {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl SetupError {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::ErrorInvalidBaseSetup => std::option::Option::Some(1),
                    Self::ErrorMissingExternalSigningKey => std::option::Option::Some(2),
                    Self::ErrorNotAllServicesEnrolled => std::option::Option::Some(3),
                    Self::ErrorSetupCheckFailed => std::option::Option::Some(4),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("SETUP_ERROR_UNSPECIFIED"),
                    Self::ErrorInvalidBaseSetup => {
                        std::option::Option::Some("ERROR_INVALID_BASE_SETUP")
                    }
                    Self::ErrorMissingExternalSigningKey => {
                        std::option::Option::Some("ERROR_MISSING_EXTERNAL_SIGNING_KEY")
                    }
                    Self::ErrorNotAllServicesEnrolled => {
                        std::option::Option::Some("ERROR_NOT_ALL_SERVICES_ENROLLED")
                    }
                    Self::ErrorSetupCheckFailed => {
                        std::option::Option::Some("ERROR_SETUP_CHECK_FAILED")
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for SetupError {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for SetupError {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for SetupError {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::ErrorInvalidBaseSetup,
                    2 => Self::ErrorMissingExternalSigningKey,
                    3 => Self::ErrorNotAllServicesEnrolled,
                    4 => Self::ErrorSetupCheckFailed,
                    _ => Self::UnknownValue(setup_error::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for SetupError {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "SETUP_ERROR_UNSPECIFIED" => Self::Unspecified,
                    "ERROR_INVALID_BASE_SETUP" => Self::ErrorInvalidBaseSetup,
                    "ERROR_MISSING_EXTERNAL_SIGNING_KEY" => Self::ErrorMissingExternalSigningKey,
                    "ERROR_NOT_ALL_SERVICES_ENROLLED" => Self::ErrorNotAllServicesEnrolled,
                    "ERROR_SETUP_CHECK_FAILED" => Self::ErrorSetupCheckFailed,
                    _ => Self::UnknownValue(setup_error::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for SetupError {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::ErrorInvalidBaseSetup => serializer.serialize_i32(1),
                    Self::ErrorMissingExternalSigningKey => serializer.serialize_i32(2),
                    Self::ErrorNotAllServicesEnrolled => serializer.serialize_i32(3),
                    Self::ErrorSetupCheckFailed => serializer.serialize_i32(4),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for SetupError {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SetupError>::new(
                    ".google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError",
                ))
            }
        }
    }

    /// Supported Compliance Regimes.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ComplianceRegime {
        /// Unknown compliance regime.
        Unspecified,
        /// Information protection as per DoD IL4 requirements.
        Il4,
        /// Criminal Justice Information Services (CJIS) Security policies.
        Cjis,
        /// FedRAMP High data protection controls
        FedrampHigh,
        /// FedRAMP Moderate data protection controls
        FedrampModerate,
        /// Assured Workloads For US Regions data protection controls
        UsRegionalAccess,
        /// Health Insurance Portability and Accountability Act controls
        Hipaa,
        /// Health Information Trust Alliance controls
        Hitrust,
        /// Assured Workloads For EU Regions and Support controls
        EuRegionsAndSupport,
        /// Assured Workloads For Canada Regions and Support controls
        CaRegionsAndSupport,
        /// International Traffic in Arms Regulations
        Itar,
        /// Assured Workloads for Australia Regions and Support controls
        /// Available for public preview consumption.
        /// Don't create production workloads.
        AuRegionsAndUsSupport,
        /// Assured Workloads for Partners
        AssuredWorkloadsForPartners,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ComplianceRegime::value] or
        /// [ComplianceRegime::name].
        UnknownValue(compliance_regime::UnknownValue),
    }

    #[doc(hidden)]
    pub mod compliance_regime {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ComplianceRegime {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Il4 => std::option::Option::Some(1),
                Self::Cjis => std::option::Option::Some(2),
                Self::FedrampHigh => std::option::Option::Some(3),
                Self::FedrampModerate => std::option::Option::Some(4),
                Self::UsRegionalAccess => std::option::Option::Some(5),
                Self::Hipaa => std::option::Option::Some(6),
                Self::Hitrust => std::option::Option::Some(7),
                Self::EuRegionsAndSupport => std::option::Option::Some(8),
                Self::CaRegionsAndSupport => std::option::Option::Some(9),
                Self::Itar => std::option::Option::Some(10),
                Self::AuRegionsAndUsSupport => std::option::Option::Some(11),
                Self::AssuredWorkloadsForPartners => std::option::Option::Some(12),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("COMPLIANCE_REGIME_UNSPECIFIED"),
                Self::Il4 => std::option::Option::Some("IL4"),
                Self::Cjis => std::option::Option::Some("CJIS"),
                Self::FedrampHigh => std::option::Option::Some("FEDRAMP_HIGH"),
                Self::FedrampModerate => std::option::Option::Some("FEDRAMP_MODERATE"),
                Self::UsRegionalAccess => std::option::Option::Some("US_REGIONAL_ACCESS"),
                Self::Hipaa => std::option::Option::Some("HIPAA"),
                Self::Hitrust => std::option::Option::Some("HITRUST"),
                Self::EuRegionsAndSupport => std::option::Option::Some("EU_REGIONS_AND_SUPPORT"),
                Self::CaRegionsAndSupport => std::option::Option::Some("CA_REGIONS_AND_SUPPORT"),
                Self::Itar => std::option::Option::Some("ITAR"),
                Self::AuRegionsAndUsSupport => {
                    std::option::Option::Some("AU_REGIONS_AND_US_SUPPORT")
                }
                Self::AssuredWorkloadsForPartners => {
                    std::option::Option::Some("ASSURED_WORKLOADS_FOR_PARTNERS")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ComplianceRegime {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ComplianceRegime {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ComplianceRegime {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Il4,
                2 => Self::Cjis,
                3 => Self::FedrampHigh,
                4 => Self::FedrampModerate,
                5 => Self::UsRegionalAccess,
                6 => Self::Hipaa,
                7 => Self::Hitrust,
                8 => Self::EuRegionsAndSupport,
                9 => Self::CaRegionsAndSupport,
                10 => Self::Itar,
                11 => Self::AuRegionsAndUsSupport,
                12 => Self::AssuredWorkloadsForPartners,
                _ => Self::UnknownValue(compliance_regime::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ComplianceRegime {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "COMPLIANCE_REGIME_UNSPECIFIED" => Self::Unspecified,
                "IL4" => Self::Il4,
                "CJIS" => Self::Cjis,
                "FEDRAMP_HIGH" => Self::FedrampHigh,
                "FEDRAMP_MODERATE" => Self::FedrampModerate,
                "US_REGIONAL_ACCESS" => Self::UsRegionalAccess,
                "HIPAA" => Self::Hipaa,
                "HITRUST" => Self::Hitrust,
                "EU_REGIONS_AND_SUPPORT" => Self::EuRegionsAndSupport,
                "CA_REGIONS_AND_SUPPORT" => Self::CaRegionsAndSupport,
                "ITAR" => Self::Itar,
                "AU_REGIONS_AND_US_SUPPORT" => Self::AuRegionsAndUsSupport,
                "ASSURED_WORKLOADS_FOR_PARTNERS" => Self::AssuredWorkloadsForPartners,
                _ => Self::UnknownValue(compliance_regime::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ComplianceRegime {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Il4 => serializer.serialize_i32(1),
                Self::Cjis => serializer.serialize_i32(2),
                Self::FedrampHigh => serializer.serialize_i32(3),
                Self::FedrampModerate => serializer.serialize_i32(4),
                Self::UsRegionalAccess => serializer.serialize_i32(5),
                Self::Hipaa => serializer.serialize_i32(6),
                Self::Hitrust => serializer.serialize_i32(7),
                Self::EuRegionsAndSupport => serializer.serialize_i32(8),
                Self::CaRegionsAndSupport => serializer.serialize_i32(9),
                Self::Itar => serializer.serialize_i32(10),
                Self::AuRegionsAndUsSupport => serializer.serialize_i32(11),
                Self::AssuredWorkloadsForPartners => serializer.serialize_i32(12),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ComplianceRegime {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceRegime>::new(
                ".google.cloud.assuredworkloads.v1.Workload.ComplianceRegime",
            ))
        }
    }

    /// Key Access Justifications(KAJ) Enrollment State.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum KajEnrollmentState {
        /// Default State for KAJ Enrollment.
        Unspecified,
        /// Pending State for KAJ Enrollment.
        Pending,
        /// Complete State for KAJ Enrollment.
        Complete,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [KajEnrollmentState::value] or
        /// [KajEnrollmentState::name].
        UnknownValue(kaj_enrollment_state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod kaj_enrollment_state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl KajEnrollmentState {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Pending => std::option::Option::Some(1),
                Self::Complete => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("KAJ_ENROLLMENT_STATE_UNSPECIFIED"),
                Self::Pending => std::option::Option::Some("KAJ_ENROLLMENT_STATE_PENDING"),
                Self::Complete => std::option::Option::Some("KAJ_ENROLLMENT_STATE_COMPLETE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for KajEnrollmentState {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for KajEnrollmentState {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for KajEnrollmentState {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Pending,
                2 => Self::Complete,
                _ => Self::UnknownValue(kaj_enrollment_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for KajEnrollmentState {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "KAJ_ENROLLMENT_STATE_UNSPECIFIED" => Self::Unspecified,
                "KAJ_ENROLLMENT_STATE_PENDING" => Self::Pending,
                "KAJ_ENROLLMENT_STATE_COMPLETE" => Self::Complete,
                _ => Self::UnknownValue(kaj_enrollment_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for KajEnrollmentState {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Pending => serializer.serialize_i32(1),
                Self::Complete => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for KajEnrollmentState {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<KajEnrollmentState>::new(
                ".google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState",
            ))
        }
    }

    /// Supported Assured Workloads Partners.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Partner {
        /// Unknown partner regime/controls.
        Unspecified,
        /// S3NS regime/controls.
        LocalControlsByS3Ns,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Partner::value] or
        /// [Partner::name].
        UnknownValue(partner::UnknownValue),
    }

    #[doc(hidden)]
    pub mod partner {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Partner {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::LocalControlsByS3Ns => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("PARTNER_UNSPECIFIED"),
                Self::LocalControlsByS3Ns => std::option::Option::Some("LOCAL_CONTROLS_BY_S3NS"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Partner {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Partner {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Partner {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::LocalControlsByS3Ns,
                _ => Self::UnknownValue(partner::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Partner {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PARTNER_UNSPECIFIED" => Self::Unspecified,
                "LOCAL_CONTROLS_BY_S3NS" => Self::LocalControlsByS3Ns,
                _ => Self::UnknownValue(partner::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Partner {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::LocalControlsByS3Ns => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Partner {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Partner>::new(
                ".google.cloud.assuredworkloads.v1.Workload.Partner",
            ))
        }
    }
}

/// Operation metadata to give request details of CreateWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkloadOperationMetadata {
    /// Optional. Time when the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The display name of the workload.
    pub display_name: std::string::String,

    /// Optional. The parent of the workload.
    pub parent: std::string::String,

    /// Optional. Compliance controls that should be applied to the resources managed by
    /// the workload.
    pub compliance_regime: crate::model::workload::ComplianceRegime,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkloadOperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::CreateWorkloadOperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::CreateWorkloadOperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [display_name][crate::model::CreateWorkloadOperationMetadata::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [parent][crate::model::CreateWorkloadOperationMetadata::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [compliance_regime][crate::model::CreateWorkloadOperationMetadata::compliance_regime].
    pub fn set_compliance_regime<
        T: std::convert::Into<crate::model::workload::ComplianceRegime>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.compliance_regime = v.into();
        self
    }
}

impl wkt::message::Message for CreateWorkloadOperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata"
    }
}

/// Request for restricting list of available resources in Workload environment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestrictAllowedResourcesRequest {
    /// Required. The resource name of the Workload. This is the workloads's
    /// relative path in the API, formatted as
    /// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    /// For example,
    /// "organizations/123/locations/us-east1/workloads/assured-workload-1".
    pub name: std::string::String,

    /// Required. The type of restriction for using gcp products in the Workload environment.
    pub restriction_type: crate::model::restrict_allowed_resources_request::RestrictionType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RestrictAllowedResourcesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RestrictAllowedResourcesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [restriction_type][crate::model::RestrictAllowedResourcesRequest::restriction_type].
    pub fn set_restriction_type<
        T: std::convert::Into<crate::model::restrict_allowed_resources_request::RestrictionType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.restriction_type = v.into();
        self
    }
}

impl wkt::message::Message for RestrictAllowedResourcesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest"
    }
}

/// Defines additional types related to [RestrictAllowedResourcesRequest].
pub mod restrict_allowed_resources_request {
    #[allow(unused_imports)]
    use super::*;

    /// The type of restriction.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum RestrictionType {
        /// Unknown restriction type.
        Unspecified,
        /// Allow the use all of all gcp products, irrespective of the compliance
        /// posture. This effectively removes gcp.restrictServiceUsage OrgPolicy
        /// on the AssuredWorkloads Folder.
        AllowAllGcpResources,
        /// Based on Workload's compliance regime, allowed list changes.
        /// See - <https://cloud.google.com/assured-workloads/docs/supported-products>
        /// for the list of supported resources.
        AllowCompliantResources,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [RestrictionType::value] or
        /// [RestrictionType::name].
        UnknownValue(restriction_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod restriction_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl RestrictionType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::AllowAllGcpResources => std::option::Option::Some(1),
                Self::AllowCompliantResources => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("RESTRICTION_TYPE_UNSPECIFIED"),
                Self::AllowAllGcpResources => std::option::Option::Some("ALLOW_ALL_GCP_RESOURCES"),
                Self::AllowCompliantResources => {
                    std::option::Option::Some("ALLOW_COMPLIANT_RESOURCES")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for RestrictionType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for RestrictionType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for RestrictionType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::AllowAllGcpResources,
                2 => Self::AllowCompliantResources,
                _ => Self::UnknownValue(restriction_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for RestrictionType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "RESTRICTION_TYPE_UNSPECIFIED" => Self::Unspecified,
                "ALLOW_ALL_GCP_RESOURCES" => Self::AllowAllGcpResources,
                "ALLOW_COMPLIANT_RESOURCES" => Self::AllowCompliantResources,
                _ => Self::UnknownValue(restriction_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for RestrictionType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::AllowAllGcpResources => serializer.serialize_i32(1),
                Self::AllowCompliantResources => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for RestrictionType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictionType>::new(
                ".google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType",
            ))
        }
    }
}

/// Response for restricting the list of allowed resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestrictAllowedResourcesResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RestrictAllowedResourcesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for RestrictAllowedResourcesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse"
    }
}

/// Request for acknowledging the violation
/// Next Id: 4
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcknowledgeViolationRequest {
    /// Required. The resource name of the Violation to acknowledge.
    /// Format:
    /// organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
    pub name: std::string::String,

    /// Required. Business justification explaining the need for violation acknowledgement
    pub comment: std::string::String,

    /// Optional. This field is deprecated and will be removed in future version of the API.
    /// Name of the OrgPolicy which was modified with non-compliant change and
    /// resulted in this violation.
    /// Format:
    /// projects/{project_number}/policies/{constraint_name}
    /// folders/{folder_id}/policies/{constraint_name}
    /// organizations/{organization_id}/policies/{constraint_name}
    #[deprecated]
    pub non_compliant_org_policy: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcknowledgeViolationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::AcknowledgeViolationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [comment][crate::model::AcknowledgeViolationRequest::comment].
    pub fn set_comment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.comment = v.into();
        self
    }

    /// Sets the value of [non_compliant_org_policy][crate::model::AcknowledgeViolationRequest::non_compliant_org_policy].
    #[deprecated]
    pub fn set_non_compliant_org_policy<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.non_compliant_org_policy = v.into();
        self
    }
}

impl wkt::message::Message for AcknowledgeViolationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest"
    }
}

/// Response for violation acknowledgement
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcknowledgeViolationResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcknowledgeViolationResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for AcknowledgeViolationResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse"
    }
}

/// Interval defining a time window.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeWindow {
    /// The start of the time window.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// The end of the time window.
    pub end_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TimeWindow {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start_time][crate::model::TimeWindow::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::TimeWindow::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::TimeWindow::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::TimeWindow::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for TimeWindow {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.TimeWindow"
    }
}

/// Request for fetching violations in an organization.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListViolationsRequest {
    /// Required. The Workload name.
    /// Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
    pub parent: std::string::String,

    /// Optional. Specifies the time window for retrieving active Violations.
    /// When specified, retrieves Violations that were active between start_time
    /// and end_time.
    pub interval: std::option::Option<crate::model::TimeWindow>,

    /// Optional. Page size.
    pub page_size: i32,

    /// Optional. Page token returned from previous request.
    pub page_token: std::string::String,

    /// Optional. A custom filter for filtering by the Violations properties.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListViolationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListViolationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [interval][crate::model::ListViolationsRequest::interval].
    pub fn set_interval<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::TimeWindow>,
    {
        self.interval = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [interval][crate::model::ListViolationsRequest::interval].
    pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::TimeWindow>,
    {
        self.interval = v.map(|x| x.into());
        self
    }

    /// Sets the value of [page_size][crate::model::ListViolationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListViolationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListViolationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListViolationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.ListViolationsRequest"
    }
}

/// Response of ListViolations endpoint.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListViolationsResponse {
    /// List of Violations under a Workload.
    pub violations: std::vec::Vec<crate::model::Violation>,

    /// The next page token. Returns empty if reached the last page.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListViolationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [violations][crate::model::ListViolationsResponse::violations].
    pub fn set_violations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Violation>,
    {
        use std::iter::Iterator;
        self.violations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListViolationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListViolationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.ListViolationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListViolationsResponse {
    type PageItem = crate::model::Violation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.violations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for fetching a Workload Violation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetViolationRequest {
    /// Required. The resource name of the Violation to fetch (ie. Violation.name).
    /// Format:
    /// organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetViolationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetViolationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetViolationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.GetViolationRequest"
    }
}

/// Workload monitoring Violation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Violation {
    /// Output only. Immutable. Name of the Violation.
    /// Format:
    /// organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
    pub name: std::string::String,

    /// Output only. Description for the Violation.
    /// e.g. OrgPolicy gcp.resourceLocations has non compliant value.
    pub description: std::string::String,

    /// Output only. Time of the event which triggered the Violation.
    pub begin_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The last time when the Violation record was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time of the event which fixed the Violation.
    /// If the violation is ACTIVE this will be empty.
    pub resolve_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Category under which this violation is mapped.
    /// e.g. Location, Service Usage, Access, Encryption, etc.
    pub category: std::string::String,

    /// Output only. State of the violation
    pub state: crate::model::violation::State,

    /// Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
    /// this violation.
    pub org_policy_constraint: std::string::String,

    /// Output only. Immutable. Audit Log Link for violated resource
    /// Format:
    /// <https://console.cloud.google.com/logs/query>;query={logName}{protoPayload.resourceName}{timeRange}{folder}
    pub audit_log_link: std::string::String,

    /// Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
    /// resulted this violation.
    /// Format:
    /// projects/{project_number}/policies/{constraint_name}
    /// folders/{folder_id}/policies/{constraint_name}
    /// organizations/{organization_id}/policies/{constraint_name}
    pub non_compliant_org_policy: std::string::String,

    /// Output only. Compliance violation remediation
    pub remediation: std::option::Option<crate::model::violation::Remediation>,

    /// Output only. A boolean that indicates if the violation is acknowledged
    pub acknowledged: bool,

    /// Optional. Timestamp when this violation was acknowledged last.
    /// This will be absent when acknowledged field is marked as false.
    pub acknowledgement_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Immutable. Audit Log link to find business justification provided for violation
    /// exception. Format:
    /// <https://console.cloud.google.com/logs/query>;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
    pub exception_audit_log_link: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Violation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Violation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Violation::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [begin_time][crate::model::Violation::begin_time].
    pub fn set_begin_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.begin_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [begin_time][crate::model::Violation::begin_time].
    pub fn set_or_clear_begin_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.begin_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Violation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Violation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resolve_time][crate::model::Violation::resolve_time].
    pub fn set_resolve_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.resolve_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resolve_time][crate::model::Violation::resolve_time].
    pub fn set_or_clear_resolve_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.resolve_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [category][crate::model::Violation::category].
    pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.category = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Violation::state].
    pub fn set_state<T: std::convert::Into<crate::model::violation::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [org_policy_constraint][crate::model::Violation::org_policy_constraint].
    pub fn set_org_policy_constraint<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.org_policy_constraint = v.into();
        self
    }

    /// Sets the value of [audit_log_link][crate::model::Violation::audit_log_link].
    pub fn set_audit_log_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.audit_log_link = v.into();
        self
    }

    /// Sets the value of [non_compliant_org_policy][crate::model::Violation::non_compliant_org_policy].
    pub fn set_non_compliant_org_policy<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.non_compliant_org_policy = v.into();
        self
    }

    /// Sets the value of [remediation][crate::model::Violation::remediation].
    pub fn set_remediation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::violation::Remediation>,
    {
        self.remediation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [remediation][crate::model::Violation::remediation].
    pub fn set_or_clear_remediation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::violation::Remediation>,
    {
        self.remediation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [acknowledged][crate::model::Violation::acknowledged].
    pub fn set_acknowledged<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.acknowledged = v.into();
        self
    }

    /// Sets the value of [acknowledgement_time][crate::model::Violation::acknowledgement_time].
    pub fn set_acknowledgement_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.acknowledgement_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [acknowledgement_time][crate::model::Violation::acknowledgement_time].
    pub fn set_or_clear_acknowledgement_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.acknowledgement_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [exception_audit_log_link][crate::model::Violation::exception_audit_log_link].
    pub fn set_exception_audit_log_link<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.exception_audit_log_link = v.into();
        self
    }
}

impl wkt::message::Message for Violation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.assuredworkloads.v1.Violation"
    }
}

/// Defines additional types related to [Violation].
pub mod violation {
    #[allow(unused_imports)]
    use super::*;

    /// Represents remediation guidance to resolve compliance violation for
    /// AssuredWorkload
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Remediation {
        /// Required. Remediation instructions to resolve violations
        pub instructions: std::option::Option<crate::model::violation::remediation::Instructions>,

        /// Values that can resolve the violation
        /// For example: for list org policy violations, this will either be the list
        /// of allowed or denied values
        pub compliant_values: std::vec::Vec<std::string::String>,

        /// Output only. Reemediation type based on the type of org policy values violated
        pub remediation_type: crate::model::violation::remediation::RemediationType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Remediation {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [instructions][crate::model::violation::Remediation::instructions].
        pub fn set_instructions<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::violation::remediation::Instructions>,
        {
            self.instructions = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [instructions][crate::model::violation::Remediation::instructions].
        pub fn set_or_clear_instructions<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::violation::remediation::Instructions>,
        {
            self.instructions = v.map(|x| x.into());
            self
        }

        /// Sets the value of [compliant_values][crate::model::violation::Remediation::compliant_values].
        pub fn set_compliant_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.compliant_values = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [remediation_type][crate::model::violation::Remediation::remediation_type].
        pub fn set_remediation_type<
            T: std::convert::Into<crate::model::violation::remediation::RemediationType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.remediation_type = v.into();
            self
        }
    }

    impl wkt::message::Message for Remediation {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.assuredworkloads.v1.Violation.Remediation"
        }
    }

    /// Defines additional types related to [Remediation].
    pub mod remediation {
        #[allow(unused_imports)]
        use super::*;

        /// Instructions to remediate violation
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct Instructions {
            /// Remediation instructions to resolve violation via gcloud cli
            pub gcloud_instructions:
                std::option::Option<crate::model::violation::remediation::instructions::Gcloud>,

            /// Remediation instructions to resolve violation via cloud console
            pub console_instructions:
                std::option::Option<crate::model::violation::remediation::instructions::Console>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl Instructions {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [gcloud_instructions][crate::model::violation::remediation::Instructions::gcloud_instructions].
            pub fn set_gcloud_instructions<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::violation::remediation::instructions::Gcloud>,
            {
                self.gcloud_instructions = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [gcloud_instructions][crate::model::violation::remediation::Instructions::gcloud_instructions].
            pub fn set_or_clear_gcloud_instructions<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::violation::remediation::instructions::Gcloud>,
            {
                self.gcloud_instructions = v.map(|x| x.into());
                self
            }

            /// Sets the value of [console_instructions][crate::model::violation::remediation::Instructions::console_instructions].
            pub fn set_console_instructions<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::violation::remediation::instructions::Console>,
            {
                self.console_instructions = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [console_instructions][crate::model::violation::remediation::Instructions::console_instructions].
            pub fn set_or_clear_console_instructions<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::violation::remediation::instructions::Console>,
            {
                self.console_instructions = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for Instructions {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions"
            }
        }

        /// Defines additional types related to [Instructions].
        pub mod instructions {
            #[allow(unused_imports)]
            use super::*;

            /// Remediation instructions to resolve violation via gcloud cli
            #[derive(Clone, Default, PartialEq)]
            #[non_exhaustive]
            pub struct Gcloud {
                /// Gcloud command to resolve violation
                pub gcloud_commands: std::vec::Vec<std::string::String>,

                /// Steps to resolve violation via gcloud cli
                pub steps: std::vec::Vec<std::string::String>,

                /// Additional urls for more information about steps
                pub additional_links: std::vec::Vec<std::string::String>,

                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
            }

            impl Gcloud {
                pub fn new() -> Self {
                    std::default::Default::default()
                }

                /// Sets the value of [gcloud_commands][crate::model::violation::remediation::instructions::Gcloud::gcloud_commands].
                pub fn set_gcloud_commands<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.gcloud_commands = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [steps][crate::model::violation::remediation::instructions::Gcloud::steps].
                pub fn set_steps<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.steps = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [additional_links][crate::model::violation::remediation::instructions::Gcloud::additional_links].
                pub fn set_additional_links<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.additional_links = v.into_iter().map(|i| i.into()).collect();
                    self
                }
            }

            impl wkt::message::Message for Gcloud {
                fn typename() -> &'static str {
                    "type.googleapis.com/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud"
                }
            }

            /// Remediation instructions to resolve violation via cloud console
            #[derive(Clone, Default, PartialEq)]
            #[non_exhaustive]
            pub struct Console {
                /// Link to console page where violations can be resolved
                pub console_uris: std::vec::Vec<std::string::String>,

                /// Steps to resolve violation via cloud console
                pub steps: std::vec::Vec<std::string::String>,

                /// Additional urls for more information about steps
                pub additional_links: std::vec::Vec<std::string::String>,

                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
            }

            impl Console {
                pub fn new() -> Self {
                    std::default::Default::default()
                }

                /// Sets the value of [console_uris][crate::model::violation::remediation::instructions::Console::console_uris].
                pub fn set_console_uris<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.console_uris = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [steps][crate::model::violation::remediation::instructions::Console::steps].
                pub fn set_steps<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.steps = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [additional_links][crate::model::violation::remediation::instructions::Console::additional_links].
                pub fn set_additional_links<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.additional_links = v.into_iter().map(|i| i.into()).collect();
                    self
                }
            }

            impl wkt::message::Message for Console {
                fn typename() -> &'static str {
                    "type.googleapis.com/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console"
                }
            }
        }

        /// Classifying remediation into various types based on the kind of
        /// violation. For example, violations caused due to changes in boolean org
        /// policy requires different remediation instructions compared to violation
        /// caused due to changes in allowed values of list org policy.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum RemediationType {
            /// Unspecified remediation type
            Unspecified,
            /// Remediation type for boolean org policy
            RemediationBooleanOrgPolicyViolation,
            /// Remediation type for list org policy which have allowed values in the
            /// monitoring rule
            RemediationListAllowedValuesOrgPolicyViolation,
            /// Remediation type for list org policy which have denied values in the
            /// monitoring rule
            RemediationListDeniedValuesOrgPolicyViolation,
            /// Remediation type for gcp.restrictCmekCryptoKeyProjects
            RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [RemediationType::value] or
            /// [RemediationType::name].
            UnknownValue(remediation_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod remediation_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl RemediationType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::RemediationBooleanOrgPolicyViolation => std::option::Option::Some(1),
                    Self::RemediationListAllowedValuesOrgPolicyViolation => {
                        std::option::Option::Some(2)
                    }
                    Self::RemediationListDeniedValuesOrgPolicyViolation => {
                        std::option::Option::Some(3)
                    }
                    Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation => {
                        std::option::Option::Some(4)
                    }
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("REMEDIATION_TYPE_UNSPECIFIED"),
                    Self::RemediationBooleanOrgPolicyViolation => {
                        std::option::Option::Some("REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION")
                    }
                    Self::RemediationListAllowedValuesOrgPolicyViolation => {
                        std::option::Option::Some(
                            "REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION",
                        )
                    }
                    Self::RemediationListDeniedValuesOrgPolicyViolation => {
                        std::option::Option::Some(
                            "REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION",
                        )
                    }
                    Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation => {
                        std::option::Option::Some(
                            "REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION",
                        )
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for RemediationType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for RemediationType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for RemediationType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::RemediationBooleanOrgPolicyViolation,
                    2 => Self::RemediationListAllowedValuesOrgPolicyViolation,
                    3 => Self::RemediationListDeniedValuesOrgPolicyViolation,
                    4 => Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation,
                    _ => Self::UnknownValue(remediation_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for RemediationType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "REMEDIATION_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION" => {
                        Self::RemediationBooleanOrgPolicyViolation
                    }
                    "REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION" => {
                        Self::RemediationListAllowedValuesOrgPolicyViolation
                    }
                    "REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION" => {
                        Self::RemediationListDeniedValuesOrgPolicyViolation
                    }
                    "REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION" => {
                        Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation
                    }
                    _ => Self::UnknownValue(remediation_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for RemediationType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::RemediationBooleanOrgPolicyViolation => serializer.serialize_i32(1),
                    Self::RemediationListAllowedValuesOrgPolicyViolation => {
                        serializer.serialize_i32(2)
                    }
                    Self::RemediationListDeniedValuesOrgPolicyViolation => {
                        serializer.serialize_i32(3)
                    }
                    Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation => {
                        serializer.serialize_i32(4)
                    }
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for RemediationType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<RemediationType>::new(
                    ".google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType",
                ))
            }
        }
    }

    /// Violation State Values
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified state.
        Unspecified,
        /// Violation is resolved.
        Resolved,
        /// Violation is Unresolved
        Unresolved,
        /// Violation is Exception
        Exception,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Resolved => std::option::Option::Some(2),
                Self::Unresolved => std::option::Option::Some(3),
                Self::Exception => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Resolved => std::option::Option::Some("RESOLVED"),
                Self::Unresolved => std::option::Option::Some("UNRESOLVED"),
                Self::Exception => std::option::Option::Some("EXCEPTION"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                2 => Self::Resolved,
                3 => Self::Unresolved,
                4 => Self::Exception,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "RESOLVED" => Self::Resolved,
                "UNRESOLVED" => Self::Unresolved,
                "EXCEPTION" => Self::Exception,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Resolved => serializer.serialize_i32(2),
                Self::Unresolved => serializer.serialize_i32(3),
                Self::Exception => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.assuredworkloads.v1.Violation.State",
            ))
        }
    }
}
